import { ref, onMounted } from "vue";
import { getHomeBannerAPI } from "@/apis/home";

export function useBanner() {
  const bannerList = ref([]);
  const getBannerList = async () => {
    const res = await getHomeBannerAPI({ distributionSite: "2" });
    console.log(JSON.stringify(res));
    bannerList.value = res.result;
  };

  onMounted(() => {
    getBannerList();
  });

  return { bannerList };
}
